import Vue from 'vue'
import Router from 'vue-router'
import Login from './../views/Login'

Vue.use(Router)

export default new Router({
    mode: 'history',    //链接里有没有#显示 hash
    routes: [
        {
            path: '/login',
            name: 'Login',
            component: Login
        },
        {
            path: '/',
            component: resolve => require(['@/components/Home'], resolve),
            meta: { title: '自述文件' },
            children:[
                {
                    path: '/workbench',
                    component: resolve => require(['@/views/Workbench'], resolve),
                    meta: { title: '工作台' }
                },
                {
                    path: '/user/userlist',
                    component: resolve => require(['@/views/User/UserList'], resolve),
                    meta: { title: '员工管理' },
                    children: [
                        {
                            path: 'add',
                            component: resolve => require(['@/views/User/Add'], resolve),
                            meta: { title: '添加员工' }
                        },
                    ]
                },
                {
                    path: '/user/aaa',
                    component: resolve => require(['@/views/User/Aaa'], resolve),
                    meta: { title: '统计分析' },
                },
                {
                    path: '/user/bbb',
                    component: resolve => require(['@/views/User/Bbb'], resolve),
                    meta: { title: '人事设置' },
                }
            ]
        }
    ]
})
